package com.tadpole.music.adapter.question;

import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.tadpole.music.R;
import com.tadpole.music.adapter.base.BaseAdapter;
import com.tadpole.music.holder.base.BaseViewHolder;
import com.tadpole.music.holder.question.DaAnViewHolder;
import com.tadpole.music.holder.question.FreeExperienceViewHolder;

import java.util.List;

/**
 * Created By 孙岩
 * on 2020/9/29
 */
public class DaAnAdapter extends BaseAdapter {
    private Activity activity;
    private DaAnViewHolder daAnViewHolder;
    // Log.e("sunyan", "自己敲击" + list.toString());
    // Log.e("sunyan", "服务器返回" + extraList.toString());
    private List<String> list;
    private List<String> extraList;

    public DaAnAdapter(Activity activity,List<String> list,List<String> extraList){
        this.activity = activity;
        this.list = list;
        this.extraList  =extraList;
    }
    @Override
    public BaseViewHolder createRelHolder(ViewGroup parent, int viewType) {
        daAnViewHolder = new DaAnViewHolder(activity, LayoutInflater.from(activity).inflate(R.layout.item_daan, parent, false),list,extraList);
        return daAnViewHolder;
    }

    @Override
    public int getRelItemCount() {
        return extraList.size();
    }

    @Override
    public void setOnItemClickListener(OnItemClickListener listener) {

    }

    @Override
    public void setOnChildClickListener(OnChildClickListener listener) {

    }

    @Override
    public void setOnLongClickListener(OnLongClickListener listener) {

    }

    @Override
    public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
        holder.init(position - mHeadViews.size());
    }
}
